import java.sql.SQLOutput;
import muyuu.muylu;
import muyuu.xifashui;
//导包 *通配符
import java.util.Arrays;
import java.util.Date;//Data这个包时在util目录下的
//这俩个也就等于 但如果他的
import java.util.*;//相当于吧util下面的包都导入了

//优先级
class text {
    public static void main(String[] args) {
        text h = new text();
        h.str(1, 2, 3);
        h.show();
        muylu hh = new muylu();
        hh.b = 20;
    }

    public int year;
    public int month;
    public int day;

    public void str(text this, int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public text() {
        this(3,4,5);
    }

    public text(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void show() {
        System.out.println(year);
        System.out.println(month);
        System.out.println(day);
        this.show1();
    }

    public void show1() {
        System.out.println("this调用的");
    }

}
//定义一个学生类 最阿红一个类一个文件
class Student {//这样写相当与时又创建了一个java文件，一般是写在不同的文件中
    private String name;
    public String gender;
    private int age;
    public double height;
    public double weight;

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public void PrintAge() {
        System.out.println(age);
    }
}
//定义一个类
class PackBag {
    //字段或变量 描述packbag
    public String brand;
    public String color;
    public String  size;
    public double price;

    //方法
    public void openPackbag() {//打开书包
        System.out.println("打开书包拉链");
    }

    public void loadThings() {
        System.out.println("装入物品");
    }

    public void colsePackbag() {
        System.out.println("关闭书包拉链");
    }
}

//快速写好一个类 右键 -> generate...
class Beef {
    private String name;
    public double price;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}

//构造犯方法
class WaterMelon {
    public String type;
    public String color;
    public double price;

    //写个构造方法 不能又返回类型，有的话就是成员方法了
    public WaterMelon() {//用来初始化变量，编译器自动运行，若没有编译器
        // 会自己创造一个，赋值为变量对应的0值
        this.type = "hadage";
        this.color = "green";
        this.price = 13.14;
    }

    //支持方法重载
    public WaterMelon(String type, String color, Double price) {
        this.type = type;
        this.color = color;
        this.price = price;
    }
}

//就地初始化
class T_Shirt{
    public String type = "half-sleeve";
    public String color = "green";
    public String materia = "cotton";

    public void show() {
        System.out.println(this.type+" "+this.color+" "+this.materia);
    }
}
public class lei {

    public static void mddain(String[] args) {
//        Date h = new Date();//获得
//        System.out.println(h);
        muylu hh = new muylu();
        hh.ss();
        xifashui h = new xifashui();
        h.text();
    }
    public static void mainss(String[] args) {
        muylu hh = new muylu("aa","bb","cc");
        System.out.println(hh.getAddress());
        hh.setAddress("NULL");
        System.out.println(hh.getAddress());
        
    }
    public static void mainmn(String[] args) {
        T_Shirt hh = new T_Shirt();
        hh.show();
    }
    public static void mainqw(String[] args) {//gouzaofanfa
        WaterMelon hh = new WaterMelon("HH","HH",234.33);
        System.out.println(hh.color);
        System.out.println(hh.price);
        System.out.println(hh.type);

    }
    public static void maaain(String[] args) {
        Student hh = new Student();
        hh.setAge(23);
        //System.out.println(hh);
        //只有通过你提供的方法才能指定的使用
        hh.PrintAge();
        //hh.age = 11;被private修饰了就不能直接更爱这个值，hh.age这样引用也不可以，必须用提供的方法才可以更改
        Beef haha = new Beef();
        haha.setName("haohci");//有private修饰
        System.out.println(haha.getName());
        haha.price = 10.2;//没有private修饰
        System.out.println(haha.getPrice());
    }
}
